package cn.tedu.charging.order.feign;

import cn.tedu.chaging.common.pojo.vo.UserInfoVO;
import cn.tedu.chaging.common.web.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;

//userService要和nacos服务列表里的服务名称一致
@FeignClient("userService")
public interface UserClient {

    //String url = "http://localhost:8083/user/info/"+userId;

    /**
     * 获取用户绑定车辆
     * @param userId
     * @return
     */
    @GetMapping("/user/info/{userId}")
    JsonResult<UserInfoVO> getUserInfo(@PathVariable("userId") Long userId);


    /**
     * 获取用户余额
     * @param userId
     * @return
     */
    @GetMapping("/user/balance/{userId}")
    JsonResult<BigDecimal> getUserBalance(@PathVariable("userId") Integer userId);

}
